{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import scipy\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 2  3  1]\n",
      " [ 4  9 10]\n",
      " [10  5  6]]\n"
     ]
    }
   ],
   "source": [
    "from scipy import linalg\n",
    "mat_ = np.array([[2,3,1], [4,9,10], [10,5,6]])           # Matrix Creation\n",
    "print(mat_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0.02409639 -0.07831325  0.12650602]\n",
      " [ 0.45783133  0.01204819 -0.09638554]\n",
      " [-0.42168675  0.12048193  0.03614458]]\n"
     ]
    }
   ],
   "source": [
    "linalg.det(mat_)                 #Determinant of the matrix\n",
    "inv_mat = linalg.inv(mat_)                  # Inverse of the matrix\n",
    "print(inv_mat)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[-0.1854159   0.0294175  -0.98221971]\n",
      " [-0.73602677 -0.66641413  0.11898237]\n",
      " [-0.65106493  0.74500122  0.14521585]]\n",
      "[ 18.34661713   5.73710697   1.57709968]\n",
      "[[-0.53555313 -0.56881403 -0.62420625]\n",
      " [ 0.84418693 -0.38076134 -0.37731848]\n",
      " [-0.02304957 -0.72902085  0.6841033 ]]\n"
     ]
    }
   ],
   "source": [
    "# Singular Value Decomposition\n",
    "comp_1, comp_2, comp_3 = linalg.svd(mat_)\n",
    "print(comp_1)\n",
    "print(comp_2)\n",
    "print(comp_3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[  1.50889918  -0.52512335   7.42721059   5.12591525   3.94046958\n",
      "  13.12785618   3.1895057   13.59008321  12.98736548  10.19862082\n",
      "  11.71655729  -0.84468695   9.93834397   0.11804304   0.42097241\n",
      "   7.08219115   9.20624758   4.5313581    1.87579898   6.22591561] \n",
      " --- \n",
      "0.225009574362\n"
     ]
    }
   ],
   "source": [
    "# Scipy Stats module\n",
    "from scipy import stats\n",
    "\n",
    "# Generating a random sample of size 20 from normal distribution with mean 3 and standard deviation 5\n",
    "rvs_20 = stats.norm.rvs(3,5 , size = 20)\n",
    "print(rvs_20, '\\n --- ')\n",
    "\n",
    "# Computing the CDF of Beta distribution with a=100 and b=130 as shape parameters at random variable 0.41\n",
    "cdf_ = scipy.stats.beta.cdf(0.41, a=100, b=130)\n",
    "print(cdf_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
